home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume18 / mush6.4 / part02 < prev    next >
Encoding:
Internet Message Format  |  1989-03-12  |  57.0 KB

  1. Subject:  v18i024:  Mail user's shell version 6.4, Part02/19
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Dan Heller <island!argv@sun.com>
  7. Posting-number: Volume 18, Issue 24
  8. Archive-name: mush6.4/part02
  9.  
  10.  
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 2 (of 19)."
  19. # Contents:  Gnurc Mailrc README-6.0 bindings.h config.h-dist
  20. #   edit_menu.c hdr_panel.c lock.c mail.icon.1 mail.icon.2
  21. #   makefile.bsd makefile.sun makefile.sys.v makefile.xenix strings.h
  22. # Wrapped by rsalz@papaya.bbn.com on Mon Mar 13 19:25:07 1989
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'Gnurc' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'Gnurc'\"
  26. else
  27. echo shar: Extracting \"'Gnurc'\" \(3198 characters\)
  28. sed "s/^X//" >'Gnurc' <<'END_OF_FILE'
  29. X# .mushrc to simulate Gnu emacs (NOT Rmail!) for curses mode
  30. X# -- Bart Schaefer (schaefer@cse.ogc.edu)
  31. X#---------------------------------------------------------------------------
  32. X# Shortcomings:
  33. X#  In compose mode, can't use C-h, C-r, C-w, DEL, etc.
  34. X#  Ought to delete most of the default bindings.  If you want remove the
  35. X#   default bindings, you can:
  36. X#    Run "mush -noinit" and do a "saveopts";
  37. X#    Edit the saved file and change every "bind" to an "unbind";
  38. X#    Remove all other extranous commands;
  39. X#    Include the resulting list at the TOP of this file.
  40. X#---------------------------------------------------------------------------
  41. X#
  42. Xset no_reverse
  43. X#
  44. X# TTY setup -- you may want to customize this, because the old interrupt
  45. X#  character and so on might not be reset correctly when mush exits.
  46. X#
  47. Xcmd ntty 'stty intr ^G dsusp undef stop undef start undef lnext undef'
  48. Xcmd rtty 'stty intr ^C dsusp ^Y stop ^S start ^Q lnext ^V'
  49. Xcmd exit 'rtty; \exit'
  50. Xcmd xit exit
  51. Xcmd x exit
  52. Xcmd quit 'update; exit'
  53. Xcmd q quit
  54. Xcmd curses 'ntty; \curses; rtty'
  55. X#
  56. X# Curses mode bindings
  57. X#
  58. X# Exiting -- try to make sure tty gets reset
  59. Xbind-macro '\CX\CC' '[line-mode]exit\n'
  60. Xbind-macro x [no-op]
  61. Xbind-macro X [no-op]
  62. Xbind-macro q [no-op]
  63. Xbind-macro Q [no-op]
  64. X# Files (folders)
  65. Xbind '\CX\CF' folder
  66. Xbind '\CX\CS' update
  67. Xbind-macro '\CXi' '[line-mode]merge '
  68. Xbind '\CX\CV' folder
  69. Xbind-macro '\CX\CW' '[save-list]*\n'
  70. X# Help
  71. Xbind '\CX\CH' help    # Can't use just C-h, it's a prefix of the others
  72. Xbind-macro '\CHa' '[bind]_\n\n\CH'    # List all curses commands
  73. Xbind-macro '\CHc' '[line-mode]bind '    # Show one binding
  74. Xbind-macro '\CHf' '[line-mode]? '    # Explain line-mode function
  75. X# Error Recovery -- very primitive, sorry
  76. Xbind '\CXu' undelete-list
  77. Xbind '\C_' undelete-list
  78. X# Searching -- sorry, can't be incremental
  79. X#  also can't repeat with same key
  80. Xbind '\CS' search-next
  81. Xbind '\CR' search-back
  82. X# Motion (the important part)
  83. Xbind '\CB' back-msg
  84. Xbind '\Eb' back-msg
  85. Xbind '\CP' back-msg
  86. Xbind '\CF' next-msg
  87. Xbind '\Ef' next-msg
  88. Xbind '\CN' next-msg
  89. Xbind '\Ea' back-msg
  90. Xbind '\Ee' next-msg
  91. Xbind '\E[' top-page
  92. Xbind '\E]' bottom-page
  93. Xbind '\CX[' screen-back
  94. Xbind '\CX]' screen-next
  95. Xbind '\E<' first-msg
  96. Xbind '\E>' last-msg
  97. Xbind '\CV' screen-next
  98. Xbind '\Ev' screen-back
  99. X# Killing/deleting ("forward", i.e. at cursor, only)
  100. Xbind '\CD' delete
  101. Xbind '\Ed' delete
  102. Xbind '\CK' delete
  103. Xbind '\Ek' delete
  104. Xbind-macro '\CW' '[line-mode]delete [getstr] | set kill\n[no-op]'
  105. Xbind-macro '\CY' '[undelete-list]$kill\n'
  106. X# Marking -- somewhat limited because can't use C-SPC (C-@)
  107. Xbind-macro '\CX\CX' '[line-mode].|set mark\n[no-op]'
  108. Xbind-macro '\Eh' '[line-mode]h|set mark\n[no-op]'
  109. Xbind-macro '\CXCP' '[line-mode]h|set mark\n[no-op]'
  110. Xbind-macro '\CXh' '[line-mode]*|set mark\n[no-op]'
  111. X# Buffers -- treated same as folders
  112. Xbind '\CXb' folder
  113. Xbind-macro '\CX\CB' '[folder]?\n\CH'    # List folders and back out
  114. Xbind-macro '\CXk' '[delete-list]*\n'
  115. X# Shells
  116. Xbind-macro '\E!'\
  117. X    '[line-mode]rtty\n[shell-escape][getline][line-mode]ntty\n'
  118. Xbind-macro '\Ex!' '[line-mode]rtty;sh\n[line-mode]ntty\n'
  119. X# Macros
  120. X#  Sorry, no appending to macros, and end with <RETURN> not `C-x )'
  121. Xbind '\CX(' bind-macro
  122. X#
  123. X# Lastly, actually reset the tty
  124. X#
  125. Xif iscurses
  126. X    ntty
  127. Xendif
  128. END_OF_FILE
  129. if test 3198 -ne `wc -c <'Gnurc'`; then
  130.     echo shar: \"'Gnurc'\" unpacked with wrong size!
  131. fi
  132. # end of 'Gnurc'
  133. fi
  134. if test -f 'Mailrc' -a "${1}" != "-c" ; then 
  135.   echo shar: Will not clobber existing file \"'Mailrc'\"
  136. else
  137. echo shar: Extracting \"'Mailrc'\" \(1447 characters\)
  138. sed "s/^X//" >'Mailrc' <<'END_OF_FILE'
  139. X# .mushrc to cause Mush to emulate UCB Mail
  140. X# -- Bart Schaefer (schaefer@cse.ogc.edu)
  141. X#----------------------------------------------------------------------------
  142. X# Shortcomings:
  143. X#  Mush does not support the "noisy phone line" flags of Mail
  144. X#   (-i command line option or "set ignore" to ignore RUBOUT characters)
  145. X#  Mush will never remove a system mailbox (no "unset keep" equivalent)
  146. X#  See comments below on (lack of) command prefix recognition
  147. X#----------------------------------------------------------------------------
  148. X#
  149. X# Set up prompting, headers
  150. X#
  151. Xset prompt='& '
  152. Xset mil_time date_received
  153. Xset hdr_format='%8.80a %D %M %-2N %5T  %l/%c "%.29s"'
  154. X#
  155. X# Set up mailing/replying miscellaneous
  156. X#
  157. Xset indent_str = "    "
  158. Xset reply_to_hdr auto_route
  159. X#
  160. X# Set up command interface
  161. X#  Note that a full emulation is difficult, because Mush does not support
  162. X#  command prefix recognition (e.g., Mail interprets "Rep" as "Reply").
  163. X#
  164. X# Don't barf if history doesn't work, but still do cmd expansion
  165. X#
  166. Xset nonobang
  167. X#
  168. X# This stuff is fine, but really needs prefix recognition.
  169. X#
  170. Xcmd Reply replysender
  171. Xcmd R replysender
  172. Xcmd chdir cd
  173. Xcmd chd cd
  174. Xcmd + next
  175. Xcmd ch cd
  176. Xcmd c copy
  177. Xcmd file folder
  178. Xcmd fi folder
  179. Xcmd hold preserve
  180. Xcmd ho hold
  181. Xcmd reply replyall
  182. Xcmd r replyall
  183. Xcmd retain "set show_hdrs='\!*'"    # Not quite right, but ...
  184. Xcmd se set
  185. Xcmd shell sh
  186. Xcmd so source
  187. Xcmd un undelete
  188. Xcmd unread 'flags \!* U'    # "unread" is undocumented in Mail
  189. Xcmd uns unset
  190. END_OF_FILE
  191. if test 1447 -ne `wc -c <'Mailrc'`; then
  192.     echo shar: \"'Mailrc'\" unpacked with wrong size!
  193. fi
  194. # end of 'Mailrc'
  195. fi
  196. if test -f 'README-6.0' -a "${1}" != "-c" ; then 
  197.   echo shar: Will not clobber existing file \"'README-6.0'\"
  198. else
  199. echo shar: Extracting \"'README-6.0'\" \(16733 characters\)
  200. sed "s/^X//" >'README-6.0' <<'END_OF_FILE'
  201. XThis is the README for release 6.0 of mush.  Note that the original README
  202. Xhas changed as well, so it should be read again.  It contains important
  203. Xinformation for installing mush on your system.
  204. X
  205. XWith this distribution, there is a file called Mailrc which can be
  206. Xused as the "default" mailrc (see config.h-dist).  This file will set
  207. Xvariables and command line aliases to make mush look as much like ucb Mail
  208. Xas it possibly can.
  209. X
  210. XNew makefile && compiler flags:
  211. X    System V machines that aren't XENIX should use the makefile.sys.v makefile.
  212. X    The old makefile.sys.v has been removed. System-V machines
  213. X    that aren't xenix may note -DUSG in the makefile.  USG is defined in
  214. X    curses.h but is required to be in the makefile if compiling without the
  215. X    curses libraries.  It should be in the makefile anyway so you never have
  216. X    to worry about it. Xenix machines should use makefile.x286 or makefile.x386
  217. X    USG should probably be defined on your xenix system unless you are running
  218. X    a _very_ old version of xenix.  I don't know how old it would be, but
  219. X    try compiling mush with USG first -- if that fails, then undefine it.
  220. X
  221. X    Some systems have regcmp/regex as their regular expression matching
  222. X    routines while others have re_comp/re_exec -- If you have regcmp,
  223. X    then you must have -DREGCMP in the makefile you're using. If you have
  224. X    both sets of routines, take a pick.  Note that some systems do not
  225. X    have either set of routines in the default libraries.  You must find
  226. X    the library to use and add it to the list of libraries to use.  If this
  227. X    is the case, your link will fail with the errors that regex and re_comp
  228. X    are undefined functions.  Read your man page for regex(3) to find where
  229. X    to locate those libraries.
  230. X
  231. X    Machines that use mail transfer agents that *do not* use a colon-less
  232. X    "From " line as a message separator should #define in config.h the string
  233. X    MSG_SEPARATOR.  Since this string is usually control characters, you
  234. X    need to specify actual ascii values for those characters.  Users of MMDF,
  235. X    for example, may use "\001\001\001\001" since some mmdf versions use four
  236. X    control-A's to separate messages.  This message separator assumes that
  237. X    there is a carriage return at the end of the string.  Systems that use
  238. X    sendmail need not concern themselves with this define.
  239. X
  240. X    Some mailers (not RFC822 compatible, like execmail and older binmail's)
  241. X    do not accept commas between addresses on outgoing mail.  Such mailers
  242. X    also tend not to add the From: field and Date: field, which are headers
  243. X    required to be compatible with RFC822.  This does not apply to BSD systems
  244. X    or systems which run sendmail.  If this applies to your system, you
  245. X    should define OLD_MAILER in config.h as "#define OLD_MAILER" or in the
  246. X    makefile in addition to the CFLAGS definition: -DOLD_MAILER.  This does not
  247. X    affect the user interface at all; mush will still enforce commas between
  248. X    addresses.  However, addresses given on the command line to the mailer
  249. X    will have commas stripped out if OLD_MAIL is defined in the makefile or
  250. X    config.h.
  251. X
  252. XSystem V:
  253. X    New functions:
  254. X    lock_file() /* returns -1 if can't lock */
  255. X    close_lock() /* unlocks and calls fclose */
  256. X    These functions also support BSD, xenix and sys-v.  These are provided
  257. X    as locking mechanisms for all systems -- ifdef's decide how to lock.
  258. X
  259. X    Support for termio functionality.  Macros in mush.h have been modified
  260. X    to provide for echo/cbreak modes to depending on the compiler flags:
  261. X    CURSES and SYSV/BSD/USG.  There are 6 different possible cases here.
  262. X
  263. X    Problem with xenix/sys-v getting the "name" from a "From:" field since
  264. X    char pointer and char arrays are different sizes.  (hdrs.c, compose_hdr())
  265. X
  266. X    sendmail mail now forks off and returns you to a mush prompt so you
  267. X    don't have to wait for the mail to be delivered.  This is true for
  268. X    both xenix and sys-v.
  269. X
  270. X    terminfo is now supported.
  271. X
  272. XCommand line arguments:
  273. X    -u [user]
  274. X    /usr/spool/mail/user is used as the current folder. If "user" isn't
  275. X    specified, /usr/spool/mail/root is used.
  276. X
  277. X    -T timeout implies -t (for toolmode), so -t is not required if -T is given.
  278. X
  279. X    If -r (readonly) flag is given on the command line or to the folder/update
  280. X    commands, the folder (or spoolfile) is opened readonly and the mail is
  281. X    *not* copied into a temporary buffer.  This speeds up IO dramatically in
  282. X    systems with slow IO or disk drives (typically, xenix/sys-v).
  283. X
  284. X    -H implies -r, so -r is not necessary.  If mush is started just to read
  285. X    the headers of your mail, then forcing read only improves performance.
  286. X
  287. X    a folder as well as an address can be given on the command line. Thus,
  288. X    % mush -f foldername address-list
  289. X    will first interactively mail to the address-list and upon return read
  290. X    in the folder "foldername".
  291. X
  292. XMisc:
  293. X    There is now an internal pager which is used if the user has no
  294. X    "pager" variable set and no environment PAGER variable.  This pager
  295. X    is very simple and understands <space> for next $crt lines, \n does
  296. X    just the next line, ^D does the next half $crt lines, and q,Q quits.
  297. X    The user can "set pager" (to null, effectively) or to the string "internal"
  298. X    to always get the internal pager.  The DEF_PAGER macro in config.h can
  299. X    be set to "internal" also. (do_pager() misc.c)
  300. X
  301. X    Mush now understands 'well-formed' addresses.  A well-formed address
  302. X    consists of tokens of the form:
  303. X
  304. X    $path
  305. X    $path (Name or comment here)
  306. X    Name or comment <$path>
  307. X    "Name or comment" $path
  308. X
  309. X    See the man page for Extensive examples and rules for what formats
  310. X    are legal, but may not be supported.
  311. X
  312. X    To: lines which are too long from incoming mail are truncated. Previously,
  313. X    a segmentation fault would result -- replies to messages containing long
  314. X    To: lines will attempt to chop off the list between addresses.
  315. X
  316. X    Add right justification in hdr_format format string field similar
  317. X    to printf style formatting.  Example:
  318. X    set hdr_format = '%-25n %7d (%l) "%s"'
  319. X    will produce a header format such that the name of the author is
  320. X    right justified 25 positions, 7 chars of the date is printed, the
  321. X    number of lines in the message and the subject surrounded by quotes.
  322. X    Also subwidths are allowed using the same dot notation as provided by
  323. X    printf.  (hdrs.c)
  324. X
  325. X    The '%S' switch for message status has been removed and the status of
  326. X    a message is always at the beginning of the message header line
  327. X    by default along with the msg number and the '>' if it's the current msg.
  328. X    There is a new status flag for replied to messages.  If a message has
  329. X    been replied to, then a 'r' is placed in the header string just after
  330. X    the first status flag.. Thus, the header:
  331. X      4 >*r Dan Heller <island!argv@sun.com> ....
  332. X    means that message 4 is the current message, it has been deleted,
  333. X    and has been replied to...
  334. X
  335. X    In the hdr_format string, the date of a message can be printed
  336. X    using the same formatting characters as the prompt uses.  %T is
  337. X    the time, etc... Note that %d still prints the whole date, but
  338. X    the new formatting characters allow parts of the date to be printed.
  339. X
  340. X    New option for mail:
  341. X    mail -s [subject]
  342. X    With no subject specified, -s forces a prompt for the subject
  343. X    header even if the variable "ask" is not set.  If a subject is
  344. X    specified, then the subject is set to that string explicitly.
  345. X    This allows the reply command to change the subject or to prompt
  346. X    to change the subject.
  347. X
  348. X    Saveopts now warns if file already exists; you must confirm overwrite.
  349. X
  350. X    Control characters typed are now understood and can be entered into
  351. X    letters etc... To enter a special control character such as your backspace
  352. X    character or kill line character use the backslash.  In the toolmode,
  353. X    use your literal next character (^V in most cases).
  354. X
  355. X    "varargs" now used in print.c to provide support for machine that
  356. X    do not stack arguments compatible with vax/68000/etc... These machines
  357. X    are Pyramids, Sun4's and more... (print.c)
  358. X
  359. X    The temporary file used to type in messages is now _closed_ before
  360. X    invoking an editor.  This is for gnuemacs users or users of other
  361. X    editors which insist on no other references to that file be open.
  362. X
  363. X    Using job control (^Z/fg) which in the headers portion of a message
  364. X    (e.g. "To: ") would cause mush to be confused about what state the program
  365. X    is in and would inadvertently show a prompt (user's $prompt) even
  366. X    tho it was executing the right code (prompting for the To: line). This
  367. X    has been fixed so that the prompt isn't given, but the To: line will
  368. X    not be reprompted.
  369. X
  370. X    Mailing to users from the command line and ^C-ing while in the To: or
  371. X    Subject: prompt would just report an interrupt and not abort the message;
  372. X    it now exits.(hdrs.c, set_header())
  373. X
  374. X    If the user's home dir isn't writable, or permissions changed during
  375. X    runtime, mush changes to ALTERNATE_HOME and tries again rather than just
  376. X    returning an error message.  If the alternate home also fails, an error
  377. X    is printed and the function aborted.
  378. X    (main.c, mail.c, start_file())
  379. X
  380. X    When updating a folder, ignored headers are now copied back regardless
  381. X    of the variable, "alwaysignore". This is necessary because the user may
  382. X    ignore headers that are required to be read when reading in a folder.
  383. X    (msgs.c, copy_msg())
  384. X
  385. X    pick has a new option to pick from an arbitrary header.
  386. X    pick -h return-path ucbvax
  387. X    searches for the string "ucbvax" in the Return-Path: header of all
  388. X    messages.
  389. X
  390. XNew Variables:
  391. X    autosign2
  392. X    Use an alternate signature for specific users.  Format for string:
  393. X    set autosign2 = "address, address, ... : <signature>"
  394. X    where "address" is a legal address (or alias) and signature is that
  395. X    described by "autosign".  the colon separates the list from the signature.
  396. X    If the colon is missing or if the list is null, the signature is used
  397. X    and no checks are made against the recipient list.  Otherwise, each
  398. X    address on the recipient list of outgoing mail must also exist in
  399. X    the autosign2 list.  Otherwise, the signature in autosign is used.
  400. X    If autosign is not set, the autosigning isn't done unless ~S is used.
  401. X
  402. X    show_hdrs (String)
  403. X    Set to a list (space and/or comma separated) of headers which are to
  404. X    be the only headers displayed when viewing a message.  This disables
  405. X    the headers suppressed by the ignore command. Example:
  406. X    set show_hdrs = "from date subject to cc"
  407. X    will only display the headers,
  408. X    From: Date: Subject: To: Cc:
  409. X    in their entirety.
  410. X
  411. X    mil_time -- if set, 24 hour military time format is used in message
  412. X    dates or if the time is used in the prompt. Otherwise, 12-hour with
  413. X    an added "am/pm" is displayed.
  414. X
  415. X    The variable "no_expand" prevents expansion of mush addresses in
  416. X    outgoing mail.  The To: line will read the same as it was typed --
  417. X    this hides the complete list of addresses of everyone on the list.
  418. X
  419. X    A new variable called "wrap" has been added.  When the last message is
  420. X    deleted, the next "current" message is usually the next undeleted message.
  421. X    If wrap is not set, then the current message remains at the end of the
  422. X    list of messages.  Similarly, if "next" ('n', CR) is specified, wrapping
  423. X    to the beginning of the list only happens if the variable is set.
  424. X
  425. X    The variable fixaddr has been removed and the variable auto_route has
  426. X    been modified to route uucp mail thru the host of the author of the
  427. X    message being replied to as well as removing redundant hostnames such as:
  428. X    host1!host2!host1!user -> host1!user
  429. X
  430. X    "cdpath" added.  This is like csh's but note you can't use ()'s to
  431. X    set the path -- use quotes: (").  When the cd command is issued,
  432. X    if there is no cdpath set, then the directory mentioned is cd'ed to.
  433. X    If there is a cdpath and the pathname given is not a full pathname,
  434. X    then each element in the cdpath is searched for the directory specified.
  435. X    Recommend putting "." first in cdpath if one is used.
  436. X
  437. X    "sendmail" -- if set, this program is used instead of the default Mail
  438. X    Transfer Agent defined as MAIL_DELIVERY in config.h ... If used, the
  439. X    default flags -i and -m are not passed along to the MTA, so any flags
  440. X    which are necessary for the MTA should be included in the sendmail
  441. X    variable's string value.
  442. X
  443. X    pre_indent_str, post_indent_str (string)
  444. X    These strings have the same properties as "hdr_format". The
  445. X    pre_indent_str string will precede the body of text interpolated into
  446. X    the message buffer and the post_indent_str will succeed the text. See
  447. X    the man page for extensive details.
  448. X
  449. X    in_reply_to (string)
  450. X    set to a string interpreted the same as "hdr_format" -- when replying
  451. X    to mail, an additionally outgoing message header In-Reply-To: is added.
  452. X    See man page for more extensive details.
  453. X
  454. X    "ask" is a boolean which is for compatibility with ucb-Mail. If set,
  455. X    you will be prompted for a subject.  otherwise, no subject prompting
  456. X    is done.
  457. X
  458. XCurses:
  459. X    In curses mode, line-mode-escape commands which contain pipes,
  460. X    :pick -s pattern | save folder
  461. X    would segmentation fault on the command that follows such commands.
  462. X    The next command to execute thinks that piping is on causing a segmentation
  463. X    fault trying to reference the non-existent message list.  This was fixed by
  464. X    resetting the DO_PIPE/IS_PIPE flags to off in the cmd_line() routine.
  465. X    (misc.c, cmd_line())
  466. X
  467. X    Quitting now goes to the bottom of the screen rather than moving
  468. X    down one line [as well as other quit-related update bugs]
  469. X    (curses.c, case C_QUIT:)
  470. X
  471. X    Updating (^U) now redraws the screen right if you weren't on the
  472. X    first "screenful" of messages. (curses.c, case C_UPDATE)
  473. X
  474. X    's' (save) command wasn't saving to mbox on no input (CR).  It tried
  475. X    to save to "" which maps to "." which is a directory.  (curses.c)
  476. X
  477. X    The bug causing the GOTO command to infinite loop if there were 0
  478. X    or 1 messages in the folder if invoked by selecting a digit key has
  479. X    been fixed.  The manual entry for how the goto command works has a
  480. X    more detailed description and gives an example for effective usage.
  481. X    Due to its versatility, there can be some screen updating problems
  482. X    if the user specifies a message list which contains a command that
  483. X    produces any "stdout" type output.  Normally, this shouldn't happen,
  484. X    because most commands which are used to "search for messages" will
  485. X    not output anything if they are being "piped".  If the user wishes
  486. X    to specify a command that produces output (like echo) then the screen
  487. X    will not be updated correctly (use ^L to redraw).  See the updated
  488. X    man page entry for details on the above.
  489. X
  490. X    The bind command doesn't require the use of \Cc to represent control
  491. X    characters anymore.  The old interface is still supported -- in fact
  492. X    control characters that are typed are converted to this ascii format
  493. X    for purposes of displaying current bindings and to allow .mushrc files
  494. X    to specify bindings in ascii format.  However, control characters may
  495. X    be typed as is.  The spacebar may be bound to a command if it is given
  496. X    in the .mushrc file or on a Mush command line.  See the manual.
  497. X
  498. XTool mode:
  499. X    Trying to start tool in icon mode sometimes aborts with segmentation
  500. X    fault.  This is caused by the window size being 0 and the message
  501. X    trying to be written to the empty window.  The routine which tries to
  502. X    output each line of the message to the window is recursive. If the line
  503. X    wraps because of the window's width being less than the length of the
  504. X    line, Addstr() finds the position in the line which wraps and calls
  505. X    itself recursively passing the remainder of the string.  The size of
  506. X    0 means that Addstr is calling itself at the the beginning of the string
  507. X    all the time.  The fix is in copy_msg where it checks to see if the
  508. X    window is large enough to attempt printing the message (msgs.c, copy_msg())
  509. X
  510. X    When changing folders, if there are no messages in the new folder,
  511. X    the last read message was still displayed leaving the user somewhat
  512. X    confused.  If there are no messages, the window is cleared. (folders.c)
  513. X
  514. X    To be consistent with the other two interfaces, both delete and
  515. X    backspace will backspace if in type-in mode. (rite.c)
  516. X
  517. X    When returning from using the editor, the window displaying the letter
  518. X    being composed would contain what the letter looked like before the editor
  519. X    was invoked.  This has been fixed by printing out the last part of the
  520. X    letter up to the size of the window available.
  521. END_OF_FILE
  522. if test 16733 -ne `wc -c <'README-6.0'`; then
  523.     echo shar: \"'README-6.0'\" unpacked with wrong size!
  524. fi
  525. # end of 'README-6.0'
  526. fi
  527. if test -f 'bindings.h' -a "${1}" != "-c" ; then 
  528.   echo shar: Will not clobber existing file \"'bindings.h'\"
  529. else
  530. echo shar: Extracting \"'bindings.h'\" \(2947 characters\)
  531. sed "s/^X//" >'bindings.h' <<'END_OF_FILE'
  532. X/* bindings.h  -- command bindings */
  533. X
  534. X#define MAX_BIND_LEN 20   /* max length a string can be to bind to a command */
  535. X#define MAX_MACRO_LEN 256 /* max length of a macro bound to a command */
  536. X
  537. X/* to see if a key sequence matches, prefixes or misses a set binding */
  538. X#define NO_MATCH    0
  539. X#define MATCH        1
  540. X#define A_PREFIX_B    2
  541. X#define B_PREFIX_A    3
  542. X
  543. X/*
  544. X * Constants to define curses mode functions.
  545. X */
  546. X#ifdef NULL_MAP
  547. X#undef NULL_MAP
  548. X#endif /* NULL_MAP */
  549. X#define NULL_MAP    (struct cmd_map *)0
  550. X
  551. X#define C_ERROR        (-1L)
  552. X#define C_NULL        0L
  553. X#define C_GOTO_MSG    1L
  554. X#define C_WRITE_LIST    2L
  555. X#define C_WRITE_MSG    3L
  556. X#define C_SAVE_LIST    4L
  557. X#define C_SAVE_MSG    5L
  558. X#define C_COPY_LIST    6L
  559. X#define C_COPY_MSG    7L
  560. X#define C_DELETE_LIST    8L
  561. X#define C_DELETE_MSG    9L
  562. X#define C_UNDEL_LIST    10L
  563. X#define C_UNDEL_MSG    11L
  564. X#define C_REDRAW    12L
  565. X#define C_REVERSE    13L
  566. X#define C_NEXT_MSG    14L
  567. X#define C_PREV_MSG    15L
  568. X#define C_FIRST_MSG    16L
  569. X#define C_LAST_MSG    17L
  570. X#define C_TOP_PAGE    18L
  571. X#define C_BOTTOM_PAGE    19L
  572. X#define C_NEXT_SCREEN    20L
  573. X#define C_PREV_SCREEN    21L
  574. X#define C_SOURCE    22L
  575. X#define C_SAVEOPTS    23L
  576. X#define C_NEXT_SEARCH    24L
  577. X#define C_PREV_SEARCH    25L
  578. X#define C_CONT_SEARCH    26L
  579. X#define C_PRESERVE    27L
  580. X#define C_REV_SORT    28L
  581. X#define C_SORT        29L
  582. X#define C_QUIT_HARD    30L
  583. X#define C_QUIT        31L
  584. X#define C_EXIT_HARD    32L
  585. X#define C_EXIT        33L
  586. X#define C_UPDATE    34L
  587. X#define C_FOLDER    35L
  588. X#define C_SHELL_ESC    36L
  589. X#define C_CURSES_ESC    37L
  590. X#define C_PRINT_MSG    38L
  591. X#define C_CHDIR        39L
  592. X#define C_VAR_SET    40L
  593. X#define C_IGNORE    41L
  594. X#define C_ALIAS        42L
  595. X#define C_OWN_HDR    43L
  596. X#define C_VERSION    44L
  597. X#define C_MAIL_FLAGS    45L
  598. X#define C_MAIL        46L
  599. X#define C_REPLY_ALL    47L
  600. X#define C_REPLY_SENDER    48L
  601. X#define C_DISPLAY_NEXT    49L
  602. X#define C_DISPLAY_MSG    50L
  603. X#define C_TOP_MSG    51L
  604. X#define C_BIND_MACRO    52L
  605. X#define C_BIND        53L
  606. X#define C_UNBIND    54L
  607. X#define C_MAP_BANG    55L
  608. X#define C_MAP        56L
  609. X#define C_MACRO        57L
  610. X#define C_HELP        58L/* THIS MUST BE THE LAST ITEM */
  611. X
  612. Xstruct cmd_map {
  613. X    /* long so glob_flags can be saved in mac_stack */
  614. X    long m_cmd;   /* the command this is mapped to  */
  615. X    char *m_str;  /* the string user types (cbreak) */
  616. X    char *x_str;  /* the string executed if a macro */
  617. X    struct cmd_map *m_next;
  618. X};
  619. X
  620. X#ifdef CURSES
  621. X
  622. X/*
  623. X * Pointers to the current active command or macro and to the map list.
  624. X *  This ought to be handled by having getcmd() return struct cmd_map *,
  625. X *  but curses_command() depends too heavily on getcmd() returning int.
  626. X */
  627. Xextern struct cmd_map *active_cmd, *cmd_map;
  628. X
  629. X#endif /* CURSES */
  630. X
  631. X/* This must be OUTSIDE the #ifdef CURSES -- needed in other modes */
  632. Xextern struct cmd_map *mac_hide;
  633. X
  634. X/*
  635. X * Special bracketing recognized within an executing
  636. X *  macro as surrounding a curses function name
  637. X */
  638. X#define MAC_LONG_CMD    '['
  639. X#define MAC_LONG_END    ']'
  640. X#define MAC_GET_STR    "getstr"
  641. X#define MAC_GET_LINE    "getline"
  642. X#define MAX_LONG_CMD    32
  643. X
  644. X/*
  645. X * External declarations for map and map! purposes
  646. X */
  647. Xextern char *c_macro();
  648. Xextern struct cmd_map *line_map, *bang_map;
  649. END_OF_FILE
  650. if test 2947 -ne `wc -c <'bindings.h'`; then
  651.     echo shar: \"'bindings.h'\" unpacked with wrong size!
  652. fi
  653. # end of 'bindings.h'
  654. fi
  655. if test -f 'config.h-dist' -a "${1}" != "-c" ; then 
  656.   echo shar: Will not clobber existing file \"'config.h-dist'\"
  657. else
  658. echo shar: Extracting \"'config.h-dist'\" \(3190 characters\)
  659. sed "s/^X//" >'config.h-dist' <<'END_OF_FILE'
  660. X/* config.h 1.1    (c) copyright 1986 (Dan Heller) */
  661. X
  662. X#define MAILRC        ".mushrc"
  663. X#define ALTERNATE_RC    ".mailrc"
  664. X#define DEFAULT_RC    "/usr/lib/Mail.rc"
  665. X#define COMMAND_HELP    "/usr/lib/cmd_help"
  666. X#ifdef SUNTOOL
  667. X#    define TOOL_HELP    "/usr/lib/tool_help"
  668. X#endif /* SUNTOOL */
  669. X#define ALTERNATE_HOME    "/tmp"       /* Path must be read/write to EVERYONE */
  670. X#define EDFILE      ".edXXXXXX"  /* file/pathname added to user's "home" */
  671. X
  672. X/* mail delivery system */
  673. X#ifdef MMDF
  674. X#define MAIL_DELIVERY    "exec MMDFBIN/submit -mlnr"
  675. X#define VERBOSE_ARG    "W"
  676. X#else /* MMDF */
  677. X#define MAIL_DELIVERY    "/usr/lib/sendmail -i"
  678. X#define VERBOSE_ARG    "-v"    /* undef if none exists */
  679. X#define METOO_ARG    "-m"    /* man sendmail for more info. */
  680. X#endif /* MMDF */
  681. X
  682. X/* Headers that will NOT be included when forwarding mail */
  683. X#define IGNORE_ON_FWD    "status"
  684. X
  685. X#define    MAXMSGS        1000    /* maximum number of messages we can read */
  686. X#define HDRSIZ BUFSIZ    /* This should not be < BUFSIZ! (but can be >) */
  687. X
  688. X#define VPRINTF        /* If your system supports the vprintf() functions,
  689. X             * True for sys-v and later sun versions (3.0+ ?).
  690. X             */
  691. X
  692. X/* If your mail transfer agent uses something *besides* "From " to separate
  693. X * adjacent messages in a folder, define MSG_SEPARATOR to be this string.
  694. X * If that string is 4 ^A's, then the string would be "\001\001\001\001"
  695. X * If you don't know what this means, leave it alone.
  696. X */
  697. X/* #define MSG_SEPARATOR "From " */
  698. X#ifdef MMDF
  699. X#ifndef OLD_MAILER
  700. X#define OLD_MAILER
  701. X#endif /* OLD_MAILER */
  702. X/*
  703. X * These values should be identical (respectively) to the contents of
  704. X * delim1 and delim2 in MMDFSRC/conf/yoursite/conf.c (sans newline).
  705. X */
  706. X#define MSG_SEPARATOR    "\001\001\001\001\n"
  707. X#define END_MSG_SEP    "\001\001\001\001\n"
  708. X/*
  709. X * You only need to define LCKDFLDIR if you have MMDF configured to use a
  710. X * locking module which accesses the global MMDF variable "lckdfldir".
  711. X * Most of you WILL NOT need this, since you probably use one of the more
  712. X * sophisticated locking modules provided with MMDF.
  713. X */
  714. X/* #define LCKDFLDIR    "/usr/spool/mmdf/lockfiles" */
  715. X
  716. X/*
  717. X * IMPORTANT NOTE: If you are trying to use mush with MMDF, you need to
  718. X * remove most of the LOCFUN declarations in the MMDF locking module which
  719. X * is in use at your site and recompile the MMDF library.  The only function
  720. X * which need not appear in the new libmmdf.a is lk_name().
  721. X */
  722. X#endif /* MMDF */
  723. X
  724. X#define LS_COMMAND    "ls"
  725. X#define FORTUNE        "/usr/games/fortune"
  726. X#define LPR        "lpr"
  727. X#define SIGNATURE    ".signature"
  728. X#ifdef HOMEMAIL
  729. X#define MAILFILE    "Mailbox"    /* or whatever */
  730. X#else /* HOMEMAIL */
  731. X#define MAILDIR        "/usr/spool/mail"
  732. X#endif /* HOMEMAIL */
  733. X
  734. X/* default settings for some variable strings */
  735. X#define DEF_PROMPT    "Msg %m of %t: "
  736. X#define DEF_PAGER    "more" /* set to "internal" to use internal pager */
  737. X#define DEF_SHELL    "csh"
  738. X#define DEF_EDITOR    "vi"
  739. X#define DEF_FOLDER    "~/Mail"        /* default Mail folder */
  740. X#define DEF_MBOX    "~/mbox"    /* default mbox */
  741. X#define DEF_INDENT_STR    "> "        /* indent included mail */
  742. X#define DEF_PRINTER    "lp"
  743. X#define DEF_ESCAPE    "~"
  744. X#define DEF_HDR_FMT    "%25f %7d (%l/%c) \"%s\"" /* default hdr_format */
  745. X#define DEF_CURSES_HELP    \
  746. X    "display save mail reply next-msg back-msg screen-next screen-back"
  747. END_OF_FILE
  748. if test 3190 -ne `wc -c <'config.h-dist'`; then
  749.     echo shar: \"'config.h-dist'\" unpacked with wrong size!
  750. fi
  751. # end of 'config.h-dist'
  752. fi
  753. if test -f 'edit_menu.c' -a "${1}" != "-c" ; then 
  754.   echo shar: Will not clobber existing file \"'edit_menu.c'\"
  755. else
  756. echo shar: Extracting \"'edit_menu.c'\" \(3334 characters\)
  757. sed "s/^X//" >'edit_menu.c' <<'END_OF_FILE'
  758. X/* @(#)edit_menu.c    (c) copyright    10/18/86 (Dan Heller) */
  759. X
  760. X/* edit_menu.c
  761. X * 
  762. X * Routine which handles the menu you get when in the msg_win while editing
  763. X * a letter.  This is just a fancy front end for ~ commands (nyuk, nyuk).
  764. X */
  765. X#include "mush.h"
  766. X
  767. X#define EDIT_IT         (char *)'e'
  768. X#define PAGE         (char *)'p'
  769. X#define INC          (char *)'i'
  770. X#define INC_HDR        (char *)'H'
  771. X#define FWD_MSG        (char *)'f'
  772. X#define TO_LIST        (char *)'t'
  773. X#define SUBJECT        (char *)'s'
  774. X#define CC_LIST        (char *)'c'
  775. X#define BC_LIST        (char *)'b'
  776. X#define ALL_HDR        (char *)'h'
  777. X#define SIGN_IT        (char *)'S'
  778. X#define NO_SIGN        (char *)'n'
  779. X#define FORT        (char *)'F'
  780. X#define NO_FORT        (char *)'N'
  781. X#define ERASE       (char *)'E'
  782. X#define SEND           (char *)'X'
  783. X#define ABORT       (char *)'q'
  784. X#define MENU_HELP    (char *)'?'
  785. X
  786. Xstatic struct menuitem edit_items[] = {
  787. X    { MENU_IMAGESTRING,  "Enter Editor",    EDIT_IT  },
  788. X    { MENU_IMAGESTRING,  "Send Letter",        SEND     },
  789. X    { MENU_IMAGESTRING,  "Abort Letter",    ABORT    },
  790. X    { MENU_IMAGESTRING,  "Review Letter",    PAGE     },
  791. X    { MENU_IMAGESTRING,  "Include Message",    INC      },
  792. X    { MENU_IMAGESTRING,  "Inc. msg w/hdr",    INC_HDR  },
  793. X    { MENU_IMAGESTRING,  "Forward message",    FWD_MSG  },
  794. X    { MENU_IMAGESTRING,  "Change To line",    TO_LIST  },
  795. X    { MENU_IMAGESTRING,  "Change Subject",    SUBJECT  },
  796. X    { MENU_IMAGESTRING,  "Change Cc list",    CC_LIST  },
  797. X    { MENU_IMAGESTRING,  "Change Bcc list",    BC_LIST  },
  798. X    { MENU_IMAGESTRING,  "Change All hdrs",    ALL_HDR  },
  799. X    { MENU_IMAGESTRING,  "Add .signature",    SIGN_IT  },
  800. X    { MENU_IMAGESTRING,  "No .signature",    NO_SIGN  },
  801. X    { MENU_IMAGESTRING,  "Add a fortune",    FORT     },
  802. X    { MENU_IMAGESTRING,  "No fortune",        NO_FORT  },
  803. X    { MENU_IMAGESTRING,  "Erase Message",    ERASE    },
  804. X    { MENU_IMAGESTRING,  "Help",        MENU_HELP  }
  805. X};
  806. X
  807. Xstatic struct menu menu = {
  808. X    MENU_IMAGESTRING, "Editing options",
  809. X    sizeof (edit_items) / sizeof (struct menuitem), edit_items,
  810. X    (struct menu *)NULL,
  811. X    NULL
  812. X};
  813. X
  814. Xedit_menu(event, fd)
  815. Xstruct inputevent *event;
  816. X{
  817. X    static char buf[5];
  818. X    struct menuitem *m_item;
  819. X    register char *action, *p = buf+1;
  820. X    struct menu *menu_ptr = &menu;
  821. X
  822. X    if (!(m_item = menu_display(&menu_ptr, event, fd)) || get_hdr_field) {
  823. X    if (get_hdr_field)
  824. X        print("Finish the message header first.");
  825. X    return;
  826. X    }
  827. X    action = m_item->mi_data;
  828. X    if (txt.x > 5)
  829. X    add_to_letter(rite('\n'));  /* flush line for him */
  830. X
  831. X    if (!msg_cnt && (action == INC || action == INC_HDR || action == FWD_MSG)) {
  832. X    print("No messages to include");
  833. X    return;
  834. X    }
  835. X    buf[0] = *escape;
  836. X    switch(action) {
  837. X    case EDIT_IT  : (void) strcpy(p, "v");
  838. X    when PAGE     : (void) strcpy(p, "p");
  839. X    when INC      : (void) strcpy(p, "i");
  840. X    when INC_HDR  : (void) strcpy(p, "H");
  841. X    when ALL_HDR  : (void) strcpy(p, "h");
  842. X    when SUBJECT  : (void) strcpy(p, "s");
  843. X    when TO_LIST  : (void) strcpy(p, "t");
  844. X    when CC_LIST  : (void) strcpy(p, "c");
  845. X    when BC_LIST  : (void) strcpy(p, "b");
  846. X    when FWD_MSG  : (void) strcpy(p, "f");
  847. X    when SIGN_IT  : (void) strcpy(p, "S");
  848. X    when NO_SIGN  : (void) strcpy(p, "S!");
  849. X    when FORT     : (void) strcpy(p, "F");
  850. X    when NO_FORT  : (void) strcpy(p, "F!");
  851. X    when ERASE    : (void) strcpy(p, "E");
  852. X    when ABORT    : (void) strcpy(p, "q");
  853. X    when SEND     : finish_up_letter(); return;
  854. X    otherwise     : (void) strcpy(p, "?");
  855. X    }
  856. X    add_to_letter(buf);
  857. X}
  858. END_OF_FILE
  859. if test 3334 -ne `wc -c <'edit_menu.c'`; then
  860.     echo shar: \"'edit_menu.c'\" unpacked with wrong size!
  861. fi
  862. # end of 'edit_menu.c'
  863. fi
  864. if test -f 'hdr_panel.c' -a "${1}" != "-c" ; then 
  865.   echo shar: Will not clobber existing file \"'hdr_panel.c'\"
  866. else
  867. echo shar: Extracting \"'hdr_panel.c'\" \(4107 characters\)
  868. sed "s/^X//" >'hdr_panel.c' <<'END_OF_FILE'
  869. X/* @(#)hdr_panel.c    (c) copyright    10/18/86 (Dan Heller) */
  870. X
  871. X#include "mush.h"
  872. X
  873. Xmake_hdr_panel(choice_args, button_args)
  874. Xchar **choice_args, **button_args;
  875. X{
  876. X    hdr_panel_sw = panel_create(tool,
  877. X    PANEL_HEIGHT, 30,
  878. X    0);
  879. X    hdr_panel = (Panel)hdr_panel_sw->ts_data;
  880. X
  881. X    msg_num_item = panel_create_item(hdr_panel, PANEL_TEXT,
  882. X    PANEL_ATTRIBUTE_LIST,        choice_args,
  883. X    PANEL_ITEM_X,            4,
  884. X    PANEL_ITEM_Y,            4,
  885. X    PANEL_LABEL_STRING,        "Range:",
  886. X    PANEL_MENU_CHOICE_STRINGS,     "Help", 0,
  887. X    PANEL_VALUE_DISPLAY_LENGTH,     10,
  888. X    PANEL_VALUE_STORED_LENGTH,     80,
  889. X    PANEL_LABEL_FONT,         fonts[DEFAULT],
  890. X    PANEL_NOTIFY_STRING,         "\n\r",
  891. X    PANEL_NOTIFY_PROC,         msg_num_done,
  892. X    0);
  893. X
  894. X    sub_hdr_item[0] = panel_create_item(hdr_panel, PANEL_CHOICE,
  895. X    PANEL_ATTRIBUTE_LIST,         choice_args,
  896. X    PANEL_ITEM_X,            149,
  897. X    PANEL_ITEM_Y,            4,
  898. X    PANEL_LABEL_IMAGE,            &mouse_left,
  899. X    PANEL_CHOICE_STRINGS,         "Help", 0,
  900. X    PANEL_NOTIFY_PROC,            read_mail,
  901. X    0);
  902. X    sub_hdr_item[1] = panel_create_item(hdr_panel, PANEL_CHOICE,
  903. X    PANEL_ATTRIBUTE_LIST,         choice_args,
  904. X    PANEL_ITEM_X,            174,
  905. X    PANEL_ITEM_Y,            4,
  906. X    PANEL_LABEL_STRING,           "Read ",
  907. X    PANEL_MENU_TITLE_IMAGE,     &mouse_left,
  908. X    PANEL_CHOICE_STRINGS,        "Help", 0,
  909. X    PANEL_NOTIFY_PROC,            read_mail,
  910. X    0);
  911. X    sub_hdr_item[2] = panel_create_item(hdr_panel, PANEL_CHOICE,
  912. X    PANEL_ATTRIBUTE_LIST,         choice_args,
  913. X    PANEL_ITEM_X,            223,
  914. X    PANEL_ITEM_Y,            4,
  915. X    PANEL_LABEL_IMAGE,            &mouse_middle,
  916. X    PANEL_CHOICE_STRINGS,         "Help", 0,
  917. X    PANEL_NOTIFY_PROC,            delete_mail,
  918. X    0);
  919. X    sub_hdr_item[3] = panel_create_item(hdr_panel, PANEL_CHOICE,
  920. X    PANEL_ATTRIBUTE_LIST,         choice_args,
  921. X    PANEL_ITEM_X,            248,
  922. X    PANEL_ITEM_Y,            4,
  923. X    PANEL_LABEL_STRING,           "Delete ",
  924. X    PANEL_MENU_TITLE_IMAGE,     &mouse_middle,
  925. X    PANEL_CHOICE_STRINGS,         "Help", 0,
  926. X    PANEL_NOTIFY_PROC,            delete_mail,
  927. X    0);
  928. X    sub_hdr_item[4] = panel_create_item(hdr_panel, PANEL_CHOICE,
  929. X    PANEL_ATTRIBUTE_LIST,         choice_args,
  930. X    PANEL_ITEM_X,            313,
  931. X    PANEL_ITEM_Y,            4,
  932. X    PANEL_LABEL_IMAGE,            &mouse_right,
  933. X    PANEL_CHOICE_STRINGS,         "Help", 0,
  934. X    PANEL_NOTIFY_PROC,            read_mail,
  935. X    0);
  936. X    sub_hdr_item[5] = panel_create_item(hdr_panel, PANEL_CHOICE,
  937. X    PANEL_ATTRIBUTE_LIST,         choice_args,
  938. X    PANEL_ITEM_X,            338,
  939. X    PANEL_ITEM_Y,            4,
  940. X    PANEL_LABEL_STRING,           "Menu ",
  941. X    PANEL_MENU_TITLE_IMAGE,            &mouse_right,
  942. X    PANEL_CHOICE_STRINGS,         "Help", 0,
  943. X    PANEL_NOTIFY_PROC,            read_mail,
  944. X    0);
  945. X
  946. X    hdr_display = panel_create_item(hdr_panel, PANEL_CHOICE,
  947. X    PANEL_ATTRIBUTE_LIST,         choice_args,
  948. X    PANEL_ITEM_X,            387,
  949. X    PANEL_ITEM_Y,            4,
  950. X    PANEL_LABEL_IMAGE,
  951. X        panel_button_image(hdr_panel, "Display", 7, fonts[DEFAULT]),
  952. X    PANEL_MENU_TITLE_STRING,     "Header Display Formats",
  953. X    PANEL_CHOICE_STRINGS,         "Show Deleted Messages",
  954. X                    "Don't Show Deleted Messages",
  955. X                    "Current Header in Bold Text",
  956. X                    "Current Header in Reverse Text",
  957. X                    "Help",
  958. X                    0,
  959. X    PANEL_NOTIFY_PROC,         display_hdrs,
  960. X    0);
  961. X
  962. X    ignore_item = panel_create_item(hdr_panel, PANEL_CHOICE,
  963. X    PANEL_ATTRIBUTE_LIST, choice_args,
  964. X    PANEL_ITEM_X,            464,
  965. X    PANEL_ITEM_Y,            4,
  966. X    PANEL_LABEL_IMAGE,
  967. X        panel_button_image(hdr_panel, "Headers", 7, fonts[DEFAULT]),
  968. X    PANEL_MENU_TITLE_STRING,     "Ignored Headers",
  969. X    PANEL_CHOICE_STRINGS,         "Current Settings",
  970. X                    "Add Values",
  971. X                    "Delete Values",
  972. X                    "Help",
  973. X                    0,
  974. X    PANEL_NOTIFY_PROC,         p_set_opts,
  975. X    0);
  976. X
  977. X    next_scr = panel_create_item(hdr_panel, PANEL_CHOICE,
  978. X    PANEL_ATTRIBUTE_LIST,         choice_args,
  979. X    PANEL_ITEM_X,            541,
  980. X    PANEL_ITEM_Y,            4,
  981. X    PANEL_LABEL_IMAGE,
  982. X        panel_button_image(hdr_panel, "Next", 4, fonts[DEFAULT]),
  983. X    PANEL_MENU_TITLE_STRING,     "Display Message Headers",
  984. X    PANEL_CHOICE_STRINGS,         "Show Next screenful",
  985. X                    "Show Previous screenful",
  986. X                    0,
  987. X    PANEL_SHOW_ITEM,         FALSE,
  988. X    PANEL_NOTIFY_PROC,        do_hdr,
  989. X    0);
  990. X
  991. X    prev_scr = panel_create_item(hdr_panel, PANEL_CHOICE,
  992. X    PANEL_ATTRIBUTE_LIST,         choice_args,
  993. X    PANEL_ITEM_X,            594,
  994. X    PANEL_ITEM_Y,            4,
  995. X    PANEL_LABEL_IMAGE,
  996. X        panel_button_image(hdr_panel, "Prev", 4, fonts[DEFAULT]),
  997. X    PANEL_MENU_TITLE_STRING,     "Display Message Headers",
  998. X    PANEL_CHOICE_STRINGS,         "Show Previous screenful",
  999. X                    "Show Next screenful",
  1000. X                    0,
  1001. X    PANEL_SHOW_ITEM,         FALSE,
  1002. X    PANEL_NOTIFY_PROC,         do_hdr,
  1003. X    0);
  1004. X}
  1005. END_OF_FILE
  1006. if test 4107 -ne `wc -c <'hdr_panel.c'`; then
  1007.     echo shar: \"'hdr_panel.c'\" unpacked with wrong size!
  1008. fi
  1009. # end of 'hdr_panel.c'
  1010. fi
  1011. if test -f 'lock.c' -a "${1}" != "-c" ; then 
  1012.   echo shar: Will not clobber existing file \"'lock.c'\"
  1013. else
  1014. echo shar: Extracting \"'lock.c'\" \(3517 characters\)
  1015. sed "s/^X//" >'lock.c' <<'END_OF_FILE'
  1016. X/*
  1017. X * lock.c -- deal with file locking on various architectures and UNIXs.
  1018. X * dot_lock() creates a file with the same name as the parameter passed
  1019. X * with the appendage ".lock" -- this is to be compatible with certain
  1020. X * systems that don't use flock or lockf or whatever they have available
  1021. X * that they don't use.
  1022. X */
  1023. X
  1024. X#ifdef USG
  1025. X#include <unistd.h>
  1026. X#endif /* USG */
  1027. X#include "mush.h"
  1028. X#if defined(SYSV) && !defined(USG)
  1029. X#include <sys/locking.h>
  1030. X#endif /* SYSV && !USG */
  1031. X
  1032. Xextern int sgid;
  1033. X#ifdef BSD
  1034. Xextern int rgid;
  1035. X#endif /* BSD */
  1036. X
  1037. X#ifdef DOT_LOCK
  1038. Xdot_lock(filename)
  1039. Xchar *filename;
  1040. X{
  1041. X    char buf[MAXPATHLEN];
  1042. X    int lockfd, cnt = 0;
  1043. X    SIGRET (*oldint)(), (*oldquit)();
  1044. X
  1045. X#ifdef BSD
  1046. X    setregid(rgid, sgid);
  1047. X#else
  1048. X    setgid(sgid);
  1049. X#endif /* BSD */
  1050. X#ifdef M_XENIX
  1051. X    if (strcmp(spoolfile, mailfile) == 0)
  1052. X    (void) sprintf(buf, "/tmp/%.10s.mlk", login);
  1053. X    else
  1054. X#endif /* M_XENIX */
  1055. X    (void) sprintf(buf, "%s.lock", filename);
  1056. X    on_intr();
  1057. X    while ((lockfd = open(buf, O_CREAT|O_WRONLY|O_EXCL, 0600)) == -1) {
  1058. X    if (errno != EEXIST) {
  1059. X        error("unable to lock %s", filename);
  1060. X        break;
  1061. X    }
  1062. X    if (cnt++ == 0)
  1063. X        print("%s already locked, waiting", filename);
  1064. X    else
  1065. X        print_more(".");
  1066. X    sleep(1);
  1067. X    if (ison(glob_flags, WAS_INTR)) {
  1068. X        print_more("\nAborted.\n");
  1069. X        break;
  1070. X    }
  1071. X    }
  1072. X    off_intr();
  1073. X    if (lockfd != -1) {
  1074. X    if (cnt)
  1075. X        print("done.\n");
  1076. X    (void) close(lockfd);
  1077. X    }
  1078. X#ifdef BSD
  1079. X    setregid(sgid, rgid);
  1080. X#else
  1081. X    setgid(getgid());
  1082. X#endif /* BSD */
  1083. X    return lockfd == -1? -1 : 0;
  1084. X}
  1085. X#endif /* DOT_LOCK */
  1086. X
  1087. Xlock_file(filename, fp)
  1088. Xchar *filename;
  1089. XFILE *fp;
  1090. X{
  1091. X#ifdef MMDF
  1092. X    if (Access(filename, W_OK) || lk_lock(filename, NULL, NULL, 0))
  1093. X    return -1;
  1094. X#else /* MMDF */
  1095. X    int fd = fileno(fp);
  1096. X
  1097. X    if (debug && do_set(set_options, "deadlock")) {
  1098. X    un_set(&set_options, "deadlock");
  1099. X    return -1;
  1100. X    }
  1101. X#ifdef SYSV
  1102. X#ifndef USG
  1103. X    (void) locking(fd, LK_LOCK, 0); /* old xenix (sys III) */
  1104. X#else
  1105. X    /* if unable to lock, tell them */
  1106. X    if (Access(filename, W_OK) || lockf(fd, F_LOCK, 0L)) /* system-v */
  1107. X    return -1;
  1108. X#endif /* USG */
  1109. X#else
  1110. X#ifdef BSD
  1111. X    {
  1112. X    int cnt = 0;
  1113. X    SIGRET (*oldint)(), (*oldquit)();
  1114. X    on_intr();
  1115. X    while (isoff(glob_flags, WAS_INTR) && flock(fd, LOCK_EX | LOCK_NB)) {
  1116. X        if (errno == EWOULDBLOCK)
  1117. X        if (!cnt)
  1118. X            print("waiting to lock \"%s\"", filename);
  1119. X        else
  1120. X            cnt++, print(".");
  1121. X        else {
  1122. X        error("Unable to lock %s", filename);
  1123. X        off_intr();
  1124. X        return -1;
  1125. X        }
  1126. X        sleep(1);
  1127. X    }
  1128. X    if (cnt)
  1129. X        print("\n");
  1130. X    off_intr();
  1131. X    if (ison(glob_flags, WAS_INTR))
  1132. X        return -1;
  1133. X    }
  1134. X#else /* BSD */
  1135. X    if (ison(glob_flags, WARNING))
  1136. X    print("There is no supported file locking function!\n");
  1137. X#endif /* BSD */
  1138. X#endif /* SYSV */
  1139. X#endif /* MMDF */
  1140. X    return 0;
  1141. X}
  1142. X
  1143. Xvoid
  1144. Xclose_lock(filename, fp)
  1145. Xchar *filename;
  1146. XFILE *fp;
  1147. X#ifdef MMDF
  1148. X{
  1149. X    (void) lk_unlock(filename, NULL, NULL);
  1150. X    fclose(fp);
  1151. X}
  1152. X#endif /* MMDF */
  1153. X{
  1154. X#ifdef DOT_LOCK
  1155. X    char buf[MAXPATHLEN];
  1156. X#ifdef BSD
  1157. X    setregid(rgid, sgid);
  1158. X#else
  1159. X    setgid(sgid);
  1160. X#endif /* BSD */
  1161. X#ifdef M_XENIX
  1162. X    if (strcmp(spoolfile, mailfile) == 0)
  1163. X    (void) unlink(sprintf(buf, "/tmp/%.10s.mlk", login));
  1164. X    else
  1165. X#endif /* M_XENIX */
  1166. X    (void) unlink(sprintf(buf, "%s.lock", filename));
  1167. X#ifdef BSD
  1168. X    setregid(sgid, rgid);
  1169. X#else
  1170. X    setgid(getgid());
  1171. X#endif /* BSD */
  1172. X#endif /* DOT_LOCK */
  1173. X
  1174. X#ifdef BSD
  1175. X    flock(fileno(fp), LOCK_UN);
  1176. X#endif /* BSD */
  1177. X#ifdef SYSV
  1178. X#ifndef USG
  1179. X    locking(fileno(fp), LK_UNLCK, 0);
  1180. X#else
  1181. X    lockf(fileno(fp), F_ULOCK, 0L);
  1182. X#endif /* USG */
  1183. X#endif /* SYSV */
  1184. X    fclose(fp);
  1185. X}
  1186. END_OF_FILE
  1187. if test 3517 -ne `wc -c <'lock.c'`; then
  1188.     echo shar: \"'lock.c'\" unpacked with wrong size!
  1189. fi
  1190. # end of 'lock.c'
  1191. fi
  1192. if test -f 'mail.icon.1' -a "${1}" != "-c" ; then 
  1193.   echo shar: Will not clobber existing file \"'mail.icon.1'\"
  1194. else
  1195. echo shar: Extracting \"'mail.icon.1'\" \(1933 characters\)
  1196. sed "s/^X//" >'mail.icon.1' <<'END_OF_FILE'
  1197. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  1198. X */
  1199. X    0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001,
  1200. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
  1201. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
  1202. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
  1203. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x1FFF,0xFFFF,0xFE01,
  1204. X    0x8000,0xFE00,0x0000,0x0181,0x8007,0x01C0,0x0000,0x0061,
  1205. X    0x8018,0x0030,0x0000,0x0011,0x8020,0x7008,0x0000,0x0011,
  1206. X    0x80C1,0xFC06,0x0000,0x0009,0x8101,0xFC01,0x0000,0x0009,
  1207. X    0x8103,0xFE01,0x0000,0x0005,0x8203,0xFE00,0x8000,0x0005,
  1208. X    0x8403,0xFE00,0x4000,0x0005,0x8401,0xFC00,0x4000,0x0005,
  1209. X    0x8801,0xFC00,0x2000,0x0005,0x8800,0x7000,0x2000,0x0005,
  1210. X    0x8800,0x0000,0x3000,0x0005,0x9000,0x0000,0x1000,0x0005,
  1211. X    0x9000,0x0000,0x1000,0x0005,0x93FF,0xFFFF,0x9000,0x0025,
  1212. X    0xA200,0x0000,0x9000,0x00E5,0xA200,0x0000,0x9000,0x03A5,
  1213. X    0xA200,0x0000,0x9000,0x0625,0xA3FF,0xFFFF,0x9000,0x1C25,
  1214. X    0xA000,0x0000,0x1000,0x3425,0xA000,0x0000,0x1000,0xC425,
  1215. X    0xA000,0x0000,0x1003,0x8425,0xA000,0x0000,0x1006,0x0425,
  1216. X    0xA000,0x0000,0x101C,0x0425,0xA000,0x0000,0x11F0,0x0425,
  1217. X    0xA000,0x0000,0x13E0,0x0445,0xA000,0x0000,0x13E0,0x0585,
  1218. X    0xA000,0x0000,0x13E0,0x0605,0xA000,0x0000,0x11C0,0x0405,
  1219. X    0xA000,0x0000,0x1000,0x000D,0xA000,0x0000,0x1000,0x0011,
  1220. X    0xA000,0x0000,0x1000,0x0021,0xA000,0x0000,0x1000,0x00C1,
  1221. X    0xA000,0x0000,0x1000,0x0101,0xA000,0x0000,0x1000,0x0601,
  1222. X    0xA000,0x0000,0x1000,0x0801,0xA000,0x0000,0x1000,0x3801,
  1223. X    0xA000,0x0000,0x1000,0x4801,0xA000,0x0000,0x1000,0x8801,
  1224. X    0xA000,0x0000,0x1003,0x0801,0xA000,0x0000,0x1004,0x0801,
  1225. X    0xA000,0x0000,0x101C,0x0801,0xA000,0x0000,0x1024,0x0801,
  1226. X    0xA000,0x0000,0x1044,0x0801,0xA000,0x0000,0x1184,0x0801,
  1227. X    0xA000,0x0000,0x1204,0x0801,0xA000,0x0000,0x1404,0x0801,
  1228. X    0xBFFF,0xFFFF,0xF804,0x0801,0x8000,0x0000,0x0004,0x0801,
  1229. X    0x8000,0x0000,0x0004,0x0801,0x8000,0x0000,0x0004,0x0801,
  1230. X    0x8000,0x0000,0x0004,0x0801,0xFFFF,0xFFFF,0xFFFF,0xFFFF
  1231. END_OF_FILE
  1232. if test 1933 -ne `wc -c <'mail.icon.1'`; then
  1233.     echo shar: \"'mail.icon.1'\" unpacked with wrong size!
  1234. fi
  1235. # end of 'mail.icon.1'
  1236. fi
  1237. if test -f 'mail.icon.2' -a "${1}" != "-c" ; then 
  1238.   echo shar: Will not clobber existing file \"'mail.icon.2'\"
  1239. else
  1240. echo shar: Extracting \"'mail.icon.2'\" \(1933 characters\)
  1241. sed "s/^X//" >'mail.icon.2' <<'END_OF_FILE'
  1242. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  1243. X */
  1244. X    0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001,
  1245. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x00E0,0x0001,
  1246. X    0x8000,0x0000,0x00DE,0x0001,0x8000,0x0000,0x00C1,0xE001,
  1247. X    0x8000,0x0000,0x00C0,0x1801,0x8000,0x0000,0x00C0,0x0801,
  1248. X    0x8000,0x0000,0x00C0,0x0801,0x8000,0x1FFF,0xFFC0,0x0E01,
  1249. X    0x8000,0xFE00,0x00C0,0x0981,0x8007,0x01C0,0x00C0,0x0861,
  1250. X    0x8018,0x0030,0x00C0,0x0811,0x8020,0x7008,0x00C0,0x0811,
  1251. X    0x80C1,0xFC06,0x00C0,0x1809,0x8101,0xBC01,0x00C0,0x6009,
  1252. X    0x8103,0x1E01,0x00C1,0x8005,0x8202,0x0E00,0x80C6,0x0005,
  1253. X    0x8404,0x0400,0x40D8,0x0005,0x8408,0x0200,0x40E0,0x0005,
  1254. X    0x8810,0x0100,0x20C0,0x0005,0x8820,0x6080,0x20C0,0x0005,
  1255. X    0x8840,0x4040,0x30C0,0x0005,0x9081,0x3020,0x10C0,0x0005,
  1256. X    0x9041,0x9C10,0x10C0,0x0005,0x93E0,0x8A0F,0x90C0,0x0005,
  1257. X    0xA210,0x6404,0x90C0,0x0005,0xA208,0x3002,0x90C0,0x0005,
  1258. X    0xA204,0x1401,0x90C0,0x0005,0xA3FF,0xFFFF,0x90C0,0x0005,
  1259. X    0xA000,0x0000,0x10C0,0x0005,0xA000,0x0000,0x10C0,0x0005,
  1260. X    0xA000,0x0000,0x10C0,0x0005,0xA000,0x0000,0x10C0,0x0005,
  1261. X    0xA000,0x0000,0x10C0,0x0005,0xA000,0x0000,0x11C0,0x0005,
  1262. X    0xA000,0x0000,0x13E0,0x0005,0xA000,0x0000,0x13E0,0x0005,
  1263. X    0xA000,0x0000,0x13E0,0x0005,0xA000,0x0000,0x11C0,0x0005,
  1264. X    0xA000,0x0000,0x1000,0x000D,0xA000,0x0000,0x1000,0x0011,
  1265. X    0xA000,0x0000,0x1000,0x0021,0xA000,0x0000,0x1000,0x00C1,
  1266. X    0xA000,0x0000,0x1000,0x0101,0xA000,0x0000,0x1000,0x0601,
  1267. X    0xA000,0x0000,0x1000,0x0801,0xA000,0x0000,0x1000,0x3001,
  1268. X    0xA000,0x0000,0x1000,0x4001,0xA000,0x0000,0x1000,0x8001,
  1269. X    0xA000,0x0000,0x1003,0x8001,0xA000,0x0000,0x1004,0x8001,
  1270. X    0xA000,0x0000,0x1018,0x8001,0xA000,0x0000,0x1020,0x8001,
  1271. X    0xA000,0x0000,0x1060,0x8001,0xA000,0x0000,0x1180,0x8001,
  1272. X    0xA000,0x0000,0x1280,0x8001,0xA000,0x0000,0x1480,0x8001,
  1273. X    0xBFFF,0xFFFF,0xFC80,0x8001,0x8000,0x0000,0x0080,0x8001,
  1274. X    0x8000,0x0000,0x0080,0x8001,0x8000,0x0000,0x0080,0x8001,
  1275. X    0x8000,0x0000,0x0080,0x8001,0xFFFF,0xFFFF,0xFFFF,0xFFFF
  1276. END_OF_FILE
  1277. if test 1933 -ne `wc -c <'mail.icon.2'`; then
  1278.     echo shar: \"'mail.icon.2'\" unpacked with wrong size!
  1279. fi
  1280. # end of 'mail.icon.2'
  1281. fi
  1282. if test -f 'makefile.bsd' -a "${1}" != "-c" ; then 
  1283.   echo shar: Will not clobber existing file \"'makefile.bsd'\"
  1284. else
  1285. echo shar: Extracting \"'makefile.bsd'\" \(1341 characters\)
  1286. sed "s/^X//" >'makefile.bsd' <<'END_OF_FILE'
  1287. X# makefile.bsd    (c) copyright 1986    (Dan Heller)
  1288. X# sunOS-4.0 users should add -DSIGRET=void to the CFLAGS line below.
  1289. X#
  1290. XHDRS= mush.h config.h-dist strings.h bindings.h options.h
  1291. X
  1292. XSRCS= main.c init.c misc.c mail.c hdrs.c execute.c commands.c print.c dates.c \
  1293. X      signals.c setopts.c msgs.c pick.c sort.c expr.c folders.c \
  1294. X      loop.c help.c viewopts.c curses.c curs_io.c bind.c file.c strings.c \
  1295. X      lock.c macros.c options.c addrs.c
  1296. XOBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
  1297. X      signals.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
  1298. X      folders.o dates.o loop.o help.o viewopts.o curses.o curs_io.o bind.o \
  1299. X      lock.o macros.o options.o addrs.o
  1300. X
  1301. XHELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
  1302. X    mush.1 Mailrc Gnurc cmd_help sample.mushrc advanced.mushrc
  1303. X
  1304. XMAKES= makefile.bsd makefile.xenix makefile.sys.v
  1305. X
  1306. XCFLAGS= -O -DCURSES -DBSD
  1307. XLDFLAGS= -s
  1308. XLINTFLAGS= -bxah -Dlint -DCURSES -DBSD
  1309. XLIBES= -lcurses -ltermlib
  1310. X
  1311. Xmush: $(OBJS)
  1312. X    @echo loading...
  1313. X    @cc $(LDFLAGS) $(OBJS) $(LIBES) -o mush
  1314. X
  1315. Xtape:
  1316. X    @tar cv $(MAKES) $(HDRS) $(SRCS) $(HELP_FILES)
  1317. X
  1318. Xtar:
  1319. X    @tar fcv MUSH $(MAKES) $(HDRS) $(SRCS) $(HELP_FILES)
  1320. X
  1321. Xtarmail:
  1322. X    tar fcv - $(MAKES) $(HDRS) $(SRCS) $(HELP_FILES) | \
  1323. X    compress | btoa > mush.tarmail
  1324. X
  1325. Xlint:
  1326. X    lint $(LINTFLAGS) $(SRCS)
  1327. X
  1328. Xclean:
  1329. X    rm -f *.o core mush
  1330. END_OF_FILE
  1331. if test 1341 -ne `wc -c <'makefile.bsd'`; then
  1332.     echo shar: \"'makefile.bsd'\" unpacked with wrong size!
  1333. fi
  1334. # end of 'makefile.bsd'
  1335. fi
  1336. if test -f 'makefile.sun' -a "${1}" != "-c" ; then 
  1337.   echo shar: Will not clobber existing file \"'makefile.sun'\"
  1338. else
  1339. echo shar: Extracting \"'makefile.sun'\" \(1569 characters\)
  1340. sed "s/^X//" >'makefile.sun' <<'END_OF_FILE'
  1341. X# makefile.sun    (c) copyright 1986    (Dan Heller)
  1342. X# sunOS-4.0 users should add -DSIGRET=void to the CFLAGS line below.
  1343. X#
  1344. XHDRS= mush.h config.h-dist strings.h bindings.h options.h
  1345. X
  1346. XSRCS= main.c init.c misc.c mail.c hdrs.c execute.c commands.c rite.c \
  1347. X      select.c doproc.c print.c signals.c addrs.c setopts.c msgs.c \
  1348. X      hdr_procs.c tool.c hdr_panel.c main_panel.c help.c viewopts.c sort.c \
  1349. X      pick.c fkeys.c expr.c folders.c dates.c loop.c edit_menu.c \
  1350. X      curses.c curs_io.c bind.c file.c strings.c lock.c macros.c options.c
  1351. X
  1352. XOBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o rite.o \
  1353. X      select.o doproc.o print.o signals.o addrs.o setopts.o msgs.o \
  1354. X      hdr_procs.o tool.o hdr_panel.o main_panel.o help.o viewopts.o sort.o \
  1355. X      pick.o fkeys.o expr.o folders.o dates.o loop.o edit_menu.o \
  1356. X      curses.o curs_io.o bind.o file.o strings.o lock.o macros.o options.o
  1357. X
  1358. XIMAGES= mail.icon.1 mail.icon.2 check.pr cycle.pr envelope.pr glasses.pr \
  1359. X    write.pr up.arrow.pr dn.arrow.pr coffee.cup.pr
  1360. X
  1361. XHELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
  1362. X    mush.1 Mailrc Gnurc sample.mushrc advanced.mushrc cmd_help tool_help
  1363. X
  1364. XMAKES= makefile.sun makefile.bsd makefile.sys.v makefile.xenix
  1365. X
  1366. XCFLAGS= -O -DSUNTOOL -DCURSES -DBSD
  1367. XLDFLAGS= -s
  1368. XLIBES= -lcurses -ltermlib -lsuntool -lsunwindow -lpixrect
  1369. XLINTFLAGS= -bxah -Dlint
  1370. X
  1371. Xmush: $(OBJS)
  1372. X    @echo loading...
  1373. X    @cc $(LDFLAGS) $(OBJS) $(LIBES) -o mush
  1374. X
  1375. Xtar:
  1376. X    @tar fcv MUSH $(HELP_FILES) $(MAKES) $(IMAGES) $(HDRS) $(SRCS)
  1377. X
  1378. Xlint:
  1379. X    make -f makefile.bsd lint
  1380. X
  1381. Xclean:
  1382. X    rm -f *.o core mush
  1383. END_OF_FILE
  1384. if test 1569 -ne `wc -c <'makefile.sun'`; then
  1385.     echo shar: \"'makefile.sun'\" unpacked with wrong size!
  1386. fi
  1387. # end of 'makefile.sun'
  1388. fi
  1389. if test -f 'makefile.sys.v' -a "${1}" != "-c" ; then 
  1390.   echo shar: Will not clobber existing file \"'makefile.sys.v'\"
  1391. else
  1392. echo shar: Extracting \"'makefile.sys.v'\" \(1342 characters\)
  1393. sed "s/^X//" >'makefile.sys.v' <<'END_OF_FILE'
  1394. X# Mush makefile for system V.  Note: SIGRET should return void for normal
  1395. X# sys-v, but Att PC users should *not* have it defined.  See the README!!
  1396. X#
  1397. XHDRS1= mush.h config.h
  1398. XHDRS2= strings.h options.h
  1399. XHDRS3= bindings.h
  1400. XSRCS1= commands.c dates.c execute.c expr.c folders.c \
  1401. X    hdrs.c init.c loop.c mail.c main.c misc.c msgs.c pick.c \
  1402. X    print.c setopts.c signals.c sort.c viewopts.c options.c lock.c
  1403. XSRCS2= bind.c curs_io.c curses.c help.c file.c strings.c macros.c addrs.c
  1404. X
  1405. XOBJS1= commands.o dates.o execute.o expr.o folders.o \
  1406. X    hdrs.o init.o loop.o mail.o main.o misc.o msgs.o pick.o \
  1407. X    print.o setopts.o signals.o sort.o viewopts.o options.o lock.o
  1408. XOBJS2= bind.o curs_io.o curses.o help.o file.o strings.o macros.o addrs.o
  1409. X
  1410. XHELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
  1411. X    mush.1 Mailrc Gnurc cmd_help sample.mushrc advanced.mushrc
  1412. XMAKES= makefile.sys.v makefile.xenix makefile.bsd
  1413. X
  1414. X# Sun OS systems who wish to compile with sys-v options:
  1415. X# CC= /usr/5bin/cc
  1416. X# CFLAGS=     -O -DSYSV -DCURSES -DUSG
  1417. X# LIBS= -L/usr/5lib -lcurses
  1418. XCFLAGS=     -O -DSYSV -DCURSES -DREGCMP -DUSG -DSIGRET=void
  1419. XLDFLAGS=     -s
  1420. XLIBS=         -lcurses -lPW
  1421. XPROG=        mush
  1422. X
  1423. X$(PROG): $(OBJS1) $(OBJS2)
  1424. X    @echo loading...
  1425. X    @$(CC) $(LDFLAGS) $(OBJS1) $(OBJS2) -o $(PROG) $(LIBS)
  1426. X
  1427. X$(OBJS1): $(HDRS1) $(HDRS2)
  1428. X$(OBJS2): $(HDRS1) $(HDRS2) $(HDRS3)
  1429. Xhelp.o: strings.h
  1430. END_OF_FILE
  1431. if test 1342 -ne `wc -c <'makefile.sys.v'`; then
  1432.     echo shar: \"'makefile.sys.v'\" unpacked with wrong size!
  1433. fi
  1434. # end of 'makefile.sys.v'
  1435. fi
  1436. if test -f 'makefile.xenix' -a "${1}" != "-c" ; then 
  1437.   echo shar: Will not clobber existing file \"'makefile.xenix'\"
  1438. else
  1439. echo shar: Extracting \"'makefile.xenix'\" \(2123 characters\)
  1440. sed "s/^X//" >'makefile.xenix' <<'END_OF_FILE'
  1441. X#
  1442. X# makefile for Xenix machines.  See "MODEL" below for your xenix type.
  1443. X# some .c files may require the -LARGE compiler flag.  Examples below.
  1444. X# This makefile assumes an 80386 machine.  If you have an 80286, see
  1445. X# notes below.  This makefile was built for SCO/microsoft xenix --if you
  1446. X# are running some other kind of xenix, you might need to change the
  1447. X# CFLAGS and LDFLAGS options.
  1448. X#
  1449. XHDRS= mush.h config.h-dist strings.h bindings.h options.h
  1450. XSRCS1= main.c init.c misc.c execute.c
  1451. XSRCS2= signals.c msgs.c pick.c viewopts.c
  1452. XSRCS3= sort.c expr.c folders.c dates.c help.c
  1453. XSRCS4= loop.c bind.c options.c
  1454. XSRCS5= commands.c setopts.c hdrs.c
  1455. XSRCS6= mail.c print.c
  1456. XSRCS7= curses.c curs_io.c
  1457. XSRCS8= file.c strings.c
  1458. XSRCS9= lock.c macros.c addrs.c
  1459. XOBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
  1460. X      signals.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
  1461. X      folders.o dates.o loop.o help.o viewopts.o bind.o curses.o curs_io.o \
  1462. X      lock.o macros.o options.o addrs.o
  1463. XHELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 README-6.4 \
  1464. X    mush.1 Mailrc Gnurc cmd_help sample.mushrc advanced.mushrc
  1465. XMAKES= makefile.sys.v makefile.xenix makefile.bsd
  1466. X
  1467. X# Memory model.  Use -M3e for 80386 machines.
  1468. X# Use -Mle for 80286 machines.
  1469. XMODEL= -M3e
  1470. X
  1471. X#
  1472. X# 80286 xenix may use this LDFLAGS define:
  1473. X#LDFLAGS= -X -lx -Mle -F 4000
  1474. XLDFLAGS= -X -lx -M3
  1475. X
  1476. XCFLAGS= $(MODEL) -O -DSYSV -DCURSES -DREGCMP -DUSG 
  1477. XLIBES= -lcurses -ltermlib
  1478. X
  1479. Xmush: $(OBJS)
  1480. X    @echo loading...
  1481. X    @cc $(LDFLAGS) $(OBJS) $(LIBES) -o mush
  1482. X
  1483. X# For 80286 machines, use these two lines...
  1484. X# misc.o:    misc.c
  1485. X#     cc $(CFLAGS) -LARGE -c misc.c
  1486. X
  1487. Xbind.o:    bind.c
  1488. X    cc $(CFLAGS) -LARGE -c bind.c
  1489. X
  1490. Xshar:
  1491. X    shar ${HELP_FILES} ${MAKES} ${HDRS}>hdr.shr
  1492. X    shar ${SRCS1} > src1.shr
  1493. X    shar ${SRCS2} > src2.shr
  1494. X    shar ${SRCS3} > src3.shr
  1495. X    shar ${SRCS4} > src4.shr
  1496. X    shar ${SRCS5} > src5.shr
  1497. X    shar ${SRCS6} > src6.shr
  1498. X    shar ${SRCS7} > src7.shr
  1499. X    shar ${SRCS8} > src8.shr
  1500. X    shar ${SRCS9} > src9.shr
  1501. X
  1502. Xtar:
  1503. X    tar fcv MUSH ${MAKES} ${HDRS} ${HELP_FILES} ${SRCS1} \
  1504. X    ${SRCS2} ${SRCS3} ${SRCS4} ${SRCS5} ${SRCS6} ${SRCS7} \
  1505. X    ${SRCS8} ${SRCS9}
  1506. X
  1507. Xclean:
  1508. X    rm -f *.o core mush
  1509. END_OF_FILE
  1510. if test 2123 -ne `wc -c <'makefile.xenix'`; then
  1511.     echo shar: \"'makefile.xenix'\" unpacked with wrong size!
  1512. fi
  1513. # end of 'makefile.xenix'
  1514. fi
  1515. if test -f 'strings.h' -a "${1}" != "-c" ; then 
  1516.   echo shar: Will not clobber existing file \"'strings.h'\"
  1517. else
  1518. echo shar: Extracting \"'strings.h'\" \(1421 characters\)
  1519. sed "s/^X//" >'strings.h' <<'END_OF_FILE'
  1520. X/* @(#)strings.h    (c) copyright 9/3/86 (Dan Heller) */
  1521. X
  1522. X/*
  1523. X * If you *know* your sprintf() returns char*, you can remove the follow
  1524. X * define.  Careful, "new" 4.3BSD's sprintf returns int.  See README
  1525. X */
  1526. X#define sprintf Sprintf
  1527. X#ifdef SYSV
  1528. X#define    index    strchr
  1529. X#define    rindex    strrchr
  1530. X#endif /* SYSV */
  1531. X
  1532. X/* External function definitions for routines described in string(3).  */
  1533. Xextern char
  1534. X    *strcat(), *strncat(), *strcpy(), *strncpy(),
  1535. X    *index(), *rindex(), *getenv();
  1536. Xextern int
  1537. X    strcmp(), strncmp(), strlen();
  1538. X
  1539. Xextern char
  1540. X    *Sprintf(),        /* See comments above function in strings.c */
  1541. X    *argv_to_string(),    /* convert a vector of strings into one string */
  1542. X    *any(),         /* return first char in str2 that exists in str1 */
  1543. X    *ctrl_strcpy(),    /* string copy converting control chars to ascii */
  1544. X    *itoa(),        /* return a string representation of a number */
  1545. X    *lcase_strcpy(),    /* just like strcpy, but convert all chars to lower */
  1546. X    *m_xlate(),        /* translate string from ascii to ctrl-char format */
  1547. X    *my_atoi(),     /* do an atoi, but return the last char parsed */
  1548. X    *no_newln(),    /* remove newline and extra whitespace - return end */
  1549. X    *savestr();        /* strcpy arg into malloc-ed memory; return address */
  1550. X
  1551. Xextern void
  1552. X    free_vec(),        /* free a malloc'ed argv */
  1553. X    print_argv(),    /* prints an argv as one string */
  1554. X    putstring(),    /* put a string */
  1555. X    xfree();        /* free malloc'ed pointers */
  1556. END_OF_FILE
  1557. if test 1421 -ne `wc -c <'strings.h'`; then
  1558.     echo shar: \"'strings.h'\" unpacked with wrong size!
  1559. fi
  1560. # end of 'strings.h'
  1561. fi
  1562. echo shar: End of archive 2 \(of 19\).
  1563. cp /dev/null ark2isdone
  1564. MISSING=""
  1565. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; do
  1566.     if test ! -f ark${I}isdone ; then
  1567.     MISSING="${MISSING} ${I}"
  1568.     fi
  1569. done
  1570. if test "${MISSING}" = "" ; then
  1571.     echo You have unpacked all 19 archives.
  1572.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1573. else
  1574.     echo You still need to unpack the following archives:
  1575.     echo "        " ${MISSING}
  1576. fi
  1577. ##  End of shell archive.
  1578. exit 0
  1579.